#include "StdAfx.h"
#include "RadiosityTimer.h"
#include "Radiosity\Radiosity.h"

RadiosityTimer::RadiosityTimer(DWORD frameDrawInterval, DWORD fovDecayInterval)
{
	::CreateTimerQueueTimer(&_frameDrawTimer, NULL, OnFrameDrawTimer, NULL, 0, frameDrawInterval, WT_EXECUTEINTIMERTHREAD);
	::CreateTimerQueueTimer(&_fovChangedTimer, NULL, OnFovDecayTimer, NULL, 0, fovDecayInterval, WT_EXECUTEINTIMERTHREAD);
}

RadiosityTimer::~RadiosityTimer(void)
{
	DeleteTimerQueueTimer(NULL, _frameDrawTimer, NULL);  
	DeleteTimerQueueTimer(NULL, _fovChangedTimer, NULL);
}

void CALLBACK RadiosityTimer::OnFrameDrawTimer(void* lpParameter, BOOLEAN TimerOrWaitFired)
{
	lpParameter;
	TimerOrWaitFired;

	Radiosity::OnFrameDrawTimer();
}

void CALLBACK RadiosityTimer::OnFovDecayTimer(void* lpParameter, BOOLEAN TimerOrWaitFired)
{
	lpParameter;
	TimerOrWaitFired;

	Radiosity::OnFovDecayTimer();
}
